import { Icon } from 'antd';
import React from 'react';
import IconFont from '@/components/IconFont';

function Status({ type, children, icon }) {
  switch (type) {
    case 'success':
      return (
        <>
          <Icon
            className="mr-5"
            type={icon || 'check-circle'}
            theme="filled"
            style={{ color: '#52c41b' }}
          />
          {children}
        </>
      );
    case 'warning':
      return (
        <>
          <Icon
            className="mr-5"
            type={icon || 'exclamation-circle'}
            theme="filled"
            style={{ color: '#faad14' }}
          />
          {children}
        </>
      );
    case 'error':
      return (
        <>
          <Icon
            className="mr-5"
            type={icon || 'close-circle'}
            theme="filled"
            style={{ color: '#f5222d' }}
          />
          {children}
        </>
      );
    case 'info':
      return (
        <>
          <Icon
            className="mr-5"
            type={icon || 'info-circle'}
            theme="filled"
            style={{ color: '#1890ff' }}
          />
          {children}
        </>
      );
    default:
      return `未知情况`;
  }
}

export default Status;
